package com.module.lemlin.rxhttp

import rxhttp.wrapper.annotations.NonNull
import rxhttp.wrapper.annotations.Nullable
import java.io.IOException

class CustomException(
    @param:NonNull val errorCode: String,
    message: String?
) : IOException(message) {

    @Nullable
    override fun getLocalizedMessage(): String {
        return errorCode
    }

    override fun toString(): String {
        return """
            ${javaClass.name}: Code=$errorCode
            message = $message
            """.trimIndent()
    }

}